﻿using System;
using System.IO;
using UnityEngine;

namespace SEXY
{
	// Token: 0x020002A0 RID: 672
	public class CharFemaleFile : CharFile
	{
		// Token: 0x06001100 RID: 4352 RVA: 0x0006C524 File Offset: 0x0006A724
		public CharFemaleFile() : base("【HoneySelectCharaFemale】", "chara/female/")
		{
			CharFileInfoCustomFemale charFileInfoCustomFemale = new CharFileInfoCustomFemale();
			this.femaleCustomInfo = charFileInfoCustomFemale;
			base.customInfo = charFileInfoCustomFemale;
			CharFileInfoClothesFemale charFileInfoClothesFemale = new CharFileInfoClothesFemale();
			this.femaleClothesInfo = charFileInfoClothesFemale;
			base.clothesInfo = charFileInfoClothesFemale;
			CharFileInfoCoordinateFemale charFileInfoCoordinateFemale = new CharFileInfoCoordinateFemale();
			this.femaleCoordinateInfo = charFileInfoCoordinateFemale;
			base.coordinateInfo = charFileInfoCoordinateFemale;
		}

		// Token: 0x1700019B RID: 411
		// (get) Token: 0x06001101 RID: 4353 RVA: 0x0006C580 File Offset: 0x0006A780
		// (set) Token: 0x06001102 RID: 4354 RVA: 0x0006C588 File Offset: 0x0006A788
		public CharFileInfoCustomFemale femaleCustomInfo { get; private set; }

		// Token: 0x1700019C RID: 412
		// (get) Token: 0x06001103 RID: 4355 RVA: 0x0006C594 File Offset: 0x0006A794
		// (set) Token: 0x06001104 RID: 4356 RVA: 0x0006C59C File Offset: 0x0006A79C
		public CharFileInfoClothesFemale femaleClothesInfo { get; private set; }

		// Token: 0x1700019D RID: 413
		// (get) Token: 0x06001105 RID: 4357 RVA: 0x0006C5A8 File Offset: 0x0006A7A8
		// (set) Token: 0x06001106 RID: 4358 RVA: 0x0006C5B0 File Offset: 0x0006A7B0
		public CharFileInfoCoordinateFemale femaleCoordinateInfo { get; private set; }

		// Token: 0x06001107 RID: 4359 RVA: 0x0006C5BC File Offset: 0x0006A7BC
		public override bool LoadFromSBPR(BinaryReader br)
		{
			CharSave_SexyBeachPR charSave_SexyBeachPR = new CharSave_SexyBeachPR(CharSave_SexyBeachPR.ConvertType.HoneySelect);
			if (!charSave_SexyBeachPR.LoadCharaFile(br))
			{
				return false;
			}
			CharSave_SexyBeachPR.SaveData savedata = charSave_SexyBeachPR.savedata;
			if (savedata.sex == 0)
			{
				GlobalData.Debug_LogWarning("角色档案的性别不同");
				return false;
			}
			this.FromSBPR(savedata);
			return true;
		}

		// Token: 0x06001108 RID: 4360 RVA: 0x0006C604 File Offset: 0x0006A804
		private void FromSBPR(CharSave_SexyBeachPR.SaveData savedata)
		{
			this.charaFileName = savedata.fileName;
			this.charaFilePNG = savedata.pngData;
			this.femaleCustomInfo.personality = savedata.personality;
			this.femaleCustomInfo.name = savedata.name;
			this.femaleCustomInfo.headId = savedata.headId;
			for (int i = 0; i < savedata.shapeBody.Length; i++)
			{
				this.femaleCustomInfo.shapeValueBody[i] = Mathf.Clamp(savedata.shapeBody[i], 0f, 1f);
			}
			for (int j = 0; j < savedata.shapeFace.Length; j++)
			{
				this.femaleCustomInfo.shapeValueFace[j] = Mathf.Clamp(savedata.shapeFace[j], 0f, 1f);
			}
			for (int k = 0; k < this.femaleCustomInfo.hairId.Length; k++)
			{
				this.femaleCustomInfo.hairId[k] = savedata.hairId[k];
				savedata.hairColor[k].CopyToHoneySelect(this.femaleCustomInfo.hairColor[k]);
				savedata.hairAcsColor[k].CopyToHoneySelect(this.femaleCustomInfo.hairAcsColor[k]);
			}
			this.femaleCustomInfo.hairType = savedata.hairType;
			this.femaleCustomInfo.texFaceId = savedata.texFaceId;
			savedata.skinColor.CopyToHoneySelect(this.femaleCustomInfo.skinColor);
			this.femaleCustomInfo.texEyeshadowId = savedata.texEyeshadowId;
			savedata.eyeshadowColor.CopyToHoneySelect(this.femaleCustomInfo.eyeshadowColor);
			this.femaleCustomInfo.texCheekId = savedata.texCheekId;
			savedata.cheekColor.CopyToHoneySelect(this.femaleCustomInfo.cheekColor);
			this.femaleCustomInfo.texLipId = savedata.texLipId;
			savedata.lipColor.CopyToHoneySelect(this.femaleCustomInfo.lipColor);
			this.femaleCustomInfo.texTattoo_fId = savedata.texTattoo_fId;
			savedata.tattoo_fColor.CopyToHoneySelect(this.femaleCustomInfo.tattoo_fColor);
			this.femaleCustomInfo.texMoleId = savedata.texMoleId;
			savedata.moleColor.CopyToHoneySelect(this.femaleCustomInfo.moleColor);
			this.femaleCustomInfo.matEyebrowId = savedata.matEyebrowId;
			savedata.eyebrowColor.CopyToHoneySelect(this.femaleCustomInfo.eyebrowColor);
			this.femaleCustomInfo.matEyelashesId = savedata.matEyelashesId;
			savedata.eyelashesColor.CopyToHoneySelect(this.femaleCustomInfo.eyelashesColor);
			this.femaleCustomInfo.matEyeLId = savedata.matEyeLId;
			savedata.eyeLColor.CopyToHoneySelect(this.femaleCustomInfo.eyeLColor);
			this.femaleCustomInfo.matEyeRId = savedata.matEyeRId;
			savedata.eyeRColor.CopyToHoneySelect(this.femaleCustomInfo.eyeRColor);
			this.femaleCustomInfo.matEyeHiId = savedata.matEyeHiId;
			savedata.eyeHiColor.CopyToHoneySelect(this.femaleCustomInfo.eyeHiColor);
			savedata.eyeWColor.CopyToHoneySelect(this.femaleCustomInfo.eyeWColor);
			this.femaleCustomInfo.texFaceDetailId = 0;
			this.femaleCustomInfo.faceDetailWeight = 0.5f;
			this.femaleCustomInfo.texBodyId = 0;
			this.femaleCustomInfo.texSunburnId = savedata.texSunburnId;
			savedata.sunburnColor.CopyToHoneySelect(this.femaleCustomInfo.sunburnColor);
			this.femaleCustomInfo.texTattoo_bId = savedata.texTattoo_bId;
			savedata.tattoo_bColor.CopyToHoneySelect(this.femaleCustomInfo.tattoo_bColor);
			this.femaleCustomInfo.matNipId = savedata.matNipId;
			savedata.nipColor.CopyToHoneySelect(this.femaleCustomInfo.nipColor);
			this.femaleCustomInfo.matUnderhairId = savedata.matUnderhairId;
			savedata.underhairColor.CopyToHoneySelect(this.femaleCustomInfo.underhairColor);
			savedata.nailColor.CopyToHoneySelect(this.femaleCustomInfo.nailColor);
			this.femaleCustomInfo.areolaSize = savedata.nipSize;
			this.femaleCustomInfo.texBodyDetailId = savedata.texBodyId + 1;
			this.femaleCustomInfo.bodyDetailWeight = savedata.bodyDetailWeight;
			this.femaleCustomInfo.bustSoftness = savedata.bustSoftness;
			this.femaleCustomInfo.bustWeight = savedata.bustWeight;
			CharFileInfoClothesFemale charFileInfoClothesFemale = new CharFileInfoClothesFemale();
			charFileInfoClothesFemale.swimType = false;
			charFileInfoClothesFemale.clothesId[0] = savedata.coord[0].clothesTopId;
			savedata.coord[0].clothesTopColor.CopyToHoneySelect(charFileInfoClothesFemale.clothesColor[0]);
			charFileInfoClothesFemale.clothesId[1] = savedata.coord[0].clothesBotId;
			savedata.coord[0].clothesBotColor.CopyToHoneySelect(charFileInfoClothesFemale.clothesColor[1]);
			charFileInfoClothesFemale.clothesId[2] = savedata.coord[0].braId;
			savedata.coord[0].braColor.CopyToHoneySelect(charFileInfoClothesFemale.clothesColor[2]);
			charFileInfoClothesFemale.clothesId[3] = savedata.coord[0].shortsId;
			savedata.coord[0].shortsColor.CopyToHoneySelect(charFileInfoClothesFemale.clothesColor[3]);
			charFileInfoClothesFemale.clothesId[7] = savedata.coord[0].glovesId;
			savedata.coord[0].glovesColor.CopyToHoneySelect(charFileInfoClothesFemale.clothesColor[7]);
			charFileInfoClothesFemale.clothesId[8] = savedata.coord[0].panstId;
			savedata.coord[0].panstColor.CopyToHoneySelect(charFileInfoClothesFemale.clothesColor[8]);
			charFileInfoClothesFemale.clothesId[9] = savedata.coord[0].socksId;
			savedata.coord[0].socksColor.CopyToHoneySelect(charFileInfoClothesFemale.clothesColor[9]);
			charFileInfoClothesFemale.clothesId[10] = savedata.coord[0].shoesId;
			savedata.coord[0].shoesColor.CopyToHoneySelect(charFileInfoClothesFemale.clothesColor[10]);
			for (int l = 0; l < 5; l++)
			{
				charFileInfoClothesFemale.accessory[l].type = savedata.accessory[0, l].accessoryType;
				charFileInfoClothesFemale.accessory[l].id = savedata.accessory[0, l].accessoryId;
				charFileInfoClothesFemale.accessory[l].parentKey = savedata.accessory[0, l].parentKey;
				charFileInfoClothesFemale.accessory[l].addPos = savedata.accessory[0, l].plusPos;
				charFileInfoClothesFemale.accessory[l].addRot = savedata.accessory[0, l].plusRot;
				charFileInfoClothesFemale.accessory[l].addScl = savedata.accessory[0, l].plusScl;
				savedata.accessoryColor[0, l].CopyToHoneySelect(charFileInfoClothesFemale.accessory[l].color);
			}
			this.femaleCoordinateInfo.SetInfo(CharDefine.CoordinateType.type00, charFileInfoClothesFemale);
			CharFileInfoClothesFemale charFileInfoClothesFemale2 = new CharFileInfoClothesFemale();
			charFileInfoClothesFemale2.swimType = true;
			charFileInfoClothesFemale2.clothesId[4] = savedata.coord[1].swimsuitId;
			savedata.coord[1].swimsuitColor.CopyToHoneySelect(charFileInfoClothesFemale2.clothesColor[4]);
			charFileInfoClothesFemale2.clothesId[5] = savedata.coord[1].swimTopId;
			savedata.coord[1].swimTopColor.CopyToHoneySelect(charFileInfoClothesFemale2.clothesColor[5]);
			charFileInfoClothesFemale2.clothesId[6] = savedata.coord[1].swimBotId;
			savedata.coord[1].swimBotColor.CopyToHoneySelect(charFileInfoClothesFemale2.clothesColor[6]);
			charFileInfoClothesFemale2.clothesId[7] = savedata.coord[1].glovesId;
			savedata.coord[1].glovesColor.CopyToHoneySelect(charFileInfoClothesFemale2.clothesColor[7]);
			charFileInfoClothesFemale2.clothesId[8] = savedata.coord[1].panstId;
			savedata.coord[1].panstColor.CopyToHoneySelect(charFileInfoClothesFemale2.clothesColor[8]);
			charFileInfoClothesFemale2.clothesId[9] = savedata.coord[1].socksId;
			savedata.coord[1].socksColor.CopyToHoneySelect(charFileInfoClothesFemale2.clothesColor[9]);
			charFileInfoClothesFemale2.clothesId[10] = savedata.coord[1].shoesId;
			savedata.coord[1].shoesColor.CopyToHoneySelect(charFileInfoClothesFemale2.clothesColor[10]);
			charFileInfoClothesFemale2.hideSwimOptTop = (savedata.stateSwimOptTop != 0);
			charFileInfoClothesFemale2.hideSwimOptBot = (savedata.stateSwimOptBot != 0);
			for (int m = 0; m < 5; m++)
			{
				charFileInfoClothesFemale2.accessory[m].type = savedata.accessory[1, m].accessoryType;
				charFileInfoClothesFemale2.accessory[m].id = savedata.accessory[1, m].accessoryId;
				charFileInfoClothesFemale2.accessory[m].parentKey = savedata.accessory[1, m].parentKey;
				charFileInfoClothesFemale2.accessory[m].addPos = savedata.accessory[1, m].plusPos;
				charFileInfoClothesFemale2.accessory[m].addRot = savedata.accessory[1, m].plusRot;
				charFileInfoClothesFemale2.accessory[m].addScl = savedata.accessory[1, m].plusScl;
				savedata.accessoryColor[1, m].CopyToHoneySelect(charFileInfoClothesFemale2.accessory[m].color);
			}
			this.femaleCoordinateInfo.SetInfo(CharDefine.CoordinateType.type02, charFileInfoClothesFemale2);
		}
	}
}
